package com.kita.system.controller;

import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kita.system.entity.SystemRecordLogsEntity;
import com.kita.system.service.SystemRecordLogsService;
import com.kita.common.utils.PageUtils;
import com.kita.common.utils.R;



/**
 * 
 *
 * @author sx
 * @email sunlightcs@gmail.com
 * @date 2022-05-21 13:37:26
 */
@RestController
@RequestMapping("system/systemrecordlogs")
public class SystemRecordLogsController {
    @Autowired
    private SystemRecordLogsService systemRecordLogsService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = systemRecordLogsService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{recordId}")
    public R info(@PathVariable("recordId") Integer recordId){
		SystemRecordLogsEntity systemRecordLogs = systemRecordLogsService.getById(recordId);

        return R.ok().put("systemRecordLogs", systemRecordLogs);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody SystemRecordLogsEntity systemRecordLogs){
		systemRecordLogsService.save(systemRecordLogs);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody SystemRecordLogsEntity systemRecordLogs){
		systemRecordLogsService.updateById(systemRecordLogs);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] recordIds){
		systemRecordLogsService.removeByIds(Arrays.asList(recordIds));

        return R.ok();
    }

}
